package flyweight;

/**
 * @author shenhan
 * @create 2020/4/3 17:11
 * @description
 */
public class Client {
    public static void main(String[] args) {
        final WebSiteFactory webSiteFactory = new WebSiteFactory();
        User user = new User("abc");
        User user2 = new User("shnehna");
        final WebSite w1 = webSiteFactory.getWebSiteCategory("新闻");
        w1.use(user);
        final WebSite w2 = webSiteFactory.getWebSiteCategory("博客");
        w2.use(user);
        final WebSite w3 = webSiteFactory.getWebSiteCategory("博客");
        w3.use(user2);
        final WebSite w4 = webSiteFactory.getWebSiteCategory("微信");
        w4.use(user2);
        final WebSite w5 = webSiteFactory.getWebSiteCategory("微信");
        w5.use(user2);
        System.out.println(webSiteFactory.getWebSiteCount());
    }
}
